namespace SimpleWebServices.Web.UI.Html.Elements
{
    using System;
    using System.Xml.Serialization;

    [XmlRoot("button")]
    public sealed class PushButton : Button, IXmlSerializable
    {
        public PushButton()
        {
        }

        public PushButton(Name id)
            : base(id)
        {
        }

        public override string Type
        {
            get
            {
                return "button";
            }
        }

        public override IElement Deserialize(string name, string type, string xml)
        {
            IElement result = null;

            if ("button".Equals(name, StringComparison.OrdinalIgnoreCase) && this.Type.Equals(type, StringComparison.OrdinalIgnoreCase))
            {
                result = xml.Deserialize<PushButton>();
            }

            return result;
        }
    }
}